import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_syt/datas/message_model.dart';
import 'package:flutter_syt/domain/widgets/simple_image_loader.dart';
import 'package:flutter_syt/theme/theme_color.dart';
import 'package:flutter_syt/utils/web_socket_utility.dart';

class ServiceMessagesImages extends StatelessWidget {
  final MessageModel model;
  ServiceMessagesImages({required this.model});
  @override
  Widget build(BuildContext context) {
    return Container(
      child: ClipRRect(
        borderRadius: model.direction == MessageDirection.RECEIVE
            ? BorderRadius.only(
                bottomLeft: Radius.circular(12),
                bottomRight: Radius.circular(12),
                topRight: Radius.circular(12))
            : BorderRadius.only(
                bottomLeft: Radius.circular(12),
                bottomRight: Radius.circular(12),
                topLeft: Radius.circular(12)),
        child: ImageLoader.loadImage(
          imageUrl: model.picUrl ?? '',
          width: 240.w,
          height: 240.w,
        ),
      ),
    );
  }
}
